package com.gov.dna.common.util;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

/**
 * 获取 HttpServletRequest 对象
 *
 * @author Zhou Miao 1204487745@qq.com
 * @version V1.0
 * @date 2019/1/7
 * @since (该版本支持的JDK版本) 1.8
 */
public class HttpContextUtils {
    public static HttpServletRequest getHttpServletRequest() {
        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
    }
}
